<!--

    Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
    Portions Copyright &#169; [2017-2025] Payara Foundation and/or affiliates.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<p><a id="task-protocolnew" name="task-protocolnew"></a><a id="GHWEB00042" name="GHWEB00042"></a></p>

<h4><a id="sthref50" name="sthref50"></a>To Create a Protocol</h4>
<a name="BEGIN" id="BEGIN"></a>
<ol>
<li>
<p>In the navigation tree, expand the Configuration node.</p>
</li>
<li>
<p>Under the Configuration node, expand the Network Config node.</p>
</li>
<li>
<p>Under the Network Config node, select the Protocols node.</p>
<p>The Protocols page opens.</p>
</li>
<li>
<p>On the Protocols page, click New.</p>
<p>The New Protocol page opens.</p>
</li>
<li>
<p>In the Name field, type a unique name for the protocol.</p>
</li>
<li>
<p>Select the Security Enabled checkbox to enable security for the protocol.</p>
<p>This option is disabled by default. If you enable security, you can use the SSL tab of the Edit Protocol page to modify the security settings.</p>
</li>
<li>
<p>Select the Status Enabled checkbox to enable the file cache.</p>
<p>This option is enabled by default.</p>
</li>
<li>
<p>In the Max Age field, type the maximum age, in seconds, for a valid cache entry.</p>
<p>This parameter controls how long cached information is used after a file has been cached. An entry older than the maximum age is replaced by a new entry for the same file. If your content changes infrequently, increase this value for improved performance.</p>
<p>The optimum maximum age depends on whether existing files are modified regularly. For example, if files are modified four times a day at regular intervals, consider setting the maximum age to 21600 seconds (6 hours). Otherwise, consider setting the maximum age to the longest time for which you are willing to serve the previous version of a file after the file has been modified.</p>
<p>The default value is 30.</p>
</li>
<li>
<p>In the Max Cache Size field, type the maximum total size (in bytes) of the file cache on disk.</p>
<p>The default value is 10485760.</p>
</li>
<li>
<p>In the Max File Count field, type the maximum number of files that can be stored in the file cache.</p>
<p>If the value is too big, the server caches little-needed files, which wastes memory. If the value is too small, the benefit of caching is lost. Try different values of this attribute to find the optimal solution for specific applications.</p>
<p>The default value is 1024.</p>
</li>
<li>
<p>In the Server Name field, type the host name to be used in the URLs the server sends to the client.</p>
<p>This name is the alias name if your server uses an alias. If your server does not use an alias, leave this field blank.</p>
<p>This value affects URLs the server automatically generates; it does not affect the URLs for directories and files stored in the server. If your server uses an alias, the server-name should be the alias name. If a colon and port number are appended, that port is used in URLs the server sends to the client.</p>
</li>
<li>
<p>From the Default Virtual Server drop-down list, select the virtual server to be associated with this protocol.</p>
<p>Use the Virtual Servers page to define virtual servers.</p>
</li>
<li>
<p>In the Redirect Port field, type the port value to be used to redirect a request to another port.</p>
<p>The Payara Server automatically redirects the request if these two conditions exist:</p>
<ul>
<li>
<p>The network listener that references this protocol is supporting non-SSL requests.</p>
</li>
<li>
<p>A request is received for which a matching security constraint requires SSL transport.</p>
</li>
</ul>
<p>If a redirect port is not specified, the Payara Server uses the port number specified in the original request. By default, no port is specified.</p>
</li>
<li>
<p>In the Max Connections field, type the maximum number of requests that can be pipelined until the connection is closed by the server.</p>
<p>The Keep-Alive subsystem periodically polls idle connections. The default value is 256.</p>
<p>Set this property to 1 to disable HTTP/1.0 keep-alive, as well as HTTP/1.1 keep-alive and pipelining. A value of 0 means requests are always rejected. A value of -1 sets no limit to the number of keep-alive connections.</p>
</li>
<li>
<p>In the Timeout field, type the maximum time in seconds that a connection can be deemed as idle and kept in the keep-alive state.</p>
<p>A value of 0 or less means that keep-alive connections are kept open indefinitely. The default value is 30 seconds.</p>
</li>
<li>
<p>Select the Upload Timeout Enabled checkbox to cause the connection for a servlet that reads bytes slowly to be closed after the Connection Upload Timeout limit is reached.</p>
<p>If this option is disabled, servlet connections do not time out. This option is disabled by default.</p>
</li>
<li>
<p>In the Connection Upload Timeout field, type the timeout for uploads, in milliseconds.</p>
<p>This field is applicable only if the Upload Timeout Disabled checkbox is selected. The default value is 300000 milliseconds.</p>
</li>
<li>
<p>In the Request Timeout field, type the number of seconds before a request times out.</p>
<p>If the request is not processed before the timeout value is reached, the request is ignored. The default value is 30 seconds.</p>
</li>
<li>
<p>In the Send Buffer Size field, type the size in bytes of the send buffer.</p>
<p>The default value is 8192 bytes.</p>
</li>
<li>
<p>In the Header Buffer Length field, type the size in bytes of the buffer used by the request processing threads to read the request data.</p>
<p>The default value is 8192 bytes.</p>
</li>
<li>
<p>In the Max Post Size field, type the maximum size in bytes of POST actions.</p>
<p>The default value is 2097152 bytes.</p>
</li>
<li>
<p>In the URI Encoding field, type the name of the character set used to decode the request URIs received.</p>
<p>The value must be a valid IANA character set name. The default value is UTF-8.</p>
</li>
<li>
<p>In the Version field, type the version of the HTTP protocol used.</p>
<p>The default value is HTTP/1.1.</p>
</li>
<li>
<p>From the Compression drop-down list, select the use of HTTP/1.1 GZIP compression to save server bandwidth.</p>
<p>Available choices are:</p>
<dl>
<dt><code>on</code></dt>
<dd>
<p>Compresses data.</p>
</dd>
<dt><code>off</code></dt>
<dd>
<p>Disables compression.</p>
</dd>
<dt><code>force</code></dt>
<dd>
<p>Forces data compression in all cases.</p>
</dd>
</dl>
<p>The default value is <code>off</code>.</p>
</li>
<li>
<p>In the Compressible Mime Types field, type a comma-separated list of MIME types for which HTTP compression is used.</p>
<p>The default value is <code>text/html,text/xml,text/plain</code>.</p>
</li>
<li>
<p>In the Compression Minimum Size field, type the minimum size of a file when compression is applied.</p>
<p>This value must be set if Compression is set to <code>on</code> or <code>force</code>. The default value is 2048 bytes.</p>
</li>
<li>
<p>In the No-Compression User Agents field, type a comma-separated list of regular expressions matching user-agents of HTTP clients for which compression should not be used.</p>
<p>By default, this value is an empty string.</p>
</li>
<li>
<p>In the Restricted User Agent field, type a list of restricted user agents on which HTTP compression is applied.</p>
<p>If no user agents are specified, HTTP compression is applied to all user agents. By default, no user agents are specified.</p>
</li>
<li>
<p>In the Default Response Type field, type a string that specifies the default response type.</p>
<p>The format is a semicolon-delimited string consisting of the content-type, encoding, language, and charset. The default value is <code>text/html; charset=iso-8859-1</code>.</p>
</li>
<li>
<p>In the Forced Response Type field, type a string that specifies the request type used if no MIME mapping is available that matches the file extension.</p>
<p>The format is a semicolon-delimited string consisting of the content-type, encoding, language, and charset. The default value is <code>text/html; charset=iso-8859-1</code>.</p>
</li>
<li>
<p>In the Adapter field, type the class name of the static resources adapter.</p>
<p>The default value is <code>com.sun.grizzly.tcp.StaticResourcesAdapter</code>.</p>
</li>
<li>
<p>Select the Comet Support Enabled checkbox to enable Comet support for the network listener that references this protocol.</p>
<p>By default, this option is disabled. If your servlet or JSP page uses Comet technology, make sure it is initialized when the Payara Server starts up by adding the <code>load-on-startup</code> element to your <code>web.xml</code> file. For example:</p>
<pre>
&lt;servlet&gt;
&lt;servlet-name&gt;CheckIn&lt;/servlet-name&gt;
&lt;servlet-class&gt;CheckInServlet&lt;/servlet-class&gt;
&lt;load-on-startup&gt;0&lt;/load-on-startup&gt;
&lt;/servlet&gt;
</pre></li>
<li>
<p>Select the DNS Lookup Enabled checkbox to enable DNS lookup.</p>
<p>This option is disabled by default.</p>
</li>
<li>
<p>Select the RCM Support Enabled checkbox to enable Resource Configuration Management (RCM).</p>
<p>This option is disabled by default.</p>
</li>
<li>
<p>Select the Trace Enabled checkbox to enable the TRACE operation.</p>
<p>If this option is disabled, the Payara Server is less susceptible to cross-site scripting attacks. This option is enabled by default.</p>
</li>
<li>
<p>Select the Auth Pass Through Enabled checkbox to indicate that the network listener that uses this protocol receives traffic from an SSL-terminating proxy server.</p>
<p>This option is disabled by default.</p>
</li>
<li>
<p>Select the Chunking Enabled checkbox to enable HTTP response chunking.</p>
<p>This option is enabled by default.</p>
</li>
</ol>
<a id="sthref51" name="sthref51"></a>
<h5>Next Steps</h5>
<p>After you create a protocol, you can create a network listener that uses the protocol.</p>
<a id="sthref52" name="sthref52"></a>
<h5>See Also</h5>
<ul>
<li>
<p><a href="task-networklistenernew.html">To Create a Network Listener</a></p>
</li>
<li>
<p><a href="task-networklisteneredit.html">To Edit a Network Listener</a></p>
</li>
<li>
<p><a href="task-networklistenerdelete.html">To Delete a Network Listener</a></p>
</li>
<li>
<p><a href="task-protocoledit.html">To Edit a Protocol</a></p>
</li>
<li>
<p><a href="task-protocolssledit.html">To Edit SSL Settings for a Protocol</a></p>
</li>
<li>
<p><a href="task-protocolhttpedit.html">To Edit HTTP Settings for a Protocol</a></p>
</li>
<li>
<p><a href="task-protocolfilecacheedit.html">To Edit File Cache Settings for a Protocol</a></p>
</li>
<li>
<p><a href="task-protocoldelete.html">To Delete a Protocol</a></p>
</li>
<li>
<p><a href="task-transportnew.html">To Create a Transport</a></p>
</li>
<li>
<p><a href="task-transportedit.html">To Edit a Transport</a></p>
</li>
<li>
<p><a href="task-transportdelete.html">To Delete a Transport</a></p>
</li>
</ul>


<small>Copyright &#169; 2005, 2017, Oracle and/or its affiliates. All rights reserved. <a href="docinfo.html">Legal Notices</a></small>
<small>Portions Copyright &#169; [2017-2020] Payara Foundation and/or affiliates.</small>
